﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using PloobsEngine.Commands;
using PloobsEngine.Cameras;

namespace PloobsEngine.Features
{
    public class SkyBoxUpdateParametersCommand : ICommand
    {
        
        private ICamera cam = null;
        private TextureCube texcube= null;
        private String texName = null;
        private Skybox sb;        
        
        
        public SkyBoxUpdateParametersCommand(ICamera cam, TextureCube texcube)
        {
            this.cam = cam;
            this.texcube = texcube;            
        }

        public SkyBoxUpdateParametersCommand(ICamera cam, String textureCubeName)
        {
            this.texName = textureCubeName;
            this.cam = cam;         
        }

        #region ICommand Members

        public void execute()
        {
            if(texcube != null)
                sb.setParameters(cam, texcube);
            else
                sb.setParameters(texName,cam);            
        }

        public void setTarget(object obj)
        {
            this.sb = obj as Skybox;            
        }

        #endregion

        #region ICommand Members


        public string TargetName
        {
            get { return Skybox.MyName; }
        }

        #endregion
    }
    
}
